home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 51 / Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso / -in_the_mag- / pdselect / blizkick / modules / remcards.asm < prev    next >
Assembly Source File  |  2000-02-16  |  2KB  |  75 lines

  1. ; FILE: Source:modules/RemCards.ASM          REV: 3 --- Removes carddisk stuff
  2.  
  3. ;
  4. ; RemCards patch for BlizKick
  5. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. ; This module removes all carddisk stuff from system thus saving some
  7. ; memory/resources.
  8. ;
  9. ; Written by Harry Sintonen.
  10. ; This source code is Public Domain.
  11. ;
  12.  
  13.     incdir    "include:"
  14.     include    "blizkickmodule.i"    ; Some required...
  15.  
  16.     SECTION    PATCH,CODE
  17. _DUMMY_LABEL
  18.     BK_PTC
  19.  
  20. ; Code is run with following incoming parameters:
  21. ;
  22. ; a0=ptr to ROM start (buffer)    eg. $1DE087B8
  23. ; a1=ptr to ROM start (ROM)    eg. $00F80000 (do *not* access!)
  24. ; d0=ROM lenght in bytes    eg. $00080000
  25. ; a2=ptr to _FindResident routine (will search ROM buffer for resident tag):
  26. ;    CALL: jsr (a2)
  27. ;      IN: a0=ptr to ROM, d0=rom len, a1=ptr to resident name
  28. ;     OUT: d0=ptr to resident (buf) or NULL
  29. ; a3=ptr to _InstallModule routine (can be used to plant a "module"):
  30. ;    CALL: jsr (a3)
  31. ;      IN: a0=ptr to ROM, d0=rom len, a1=ptr to module, d6=dosbase
  32. ;     OUT: d0=success
  33. ; a4=ptr to _Printf routine (will dump some silly things (errormsg?) to stdout ;-)
  34. ;    CALL: jsr (a4)
  35. ;      IN: a0=FmtString, a1=Array (may be 0), d6=dosbase
  36. ;     OUT: -
  37. ; d6=dosbase, a6=execbase
  38. ;
  39. ; Code should return:
  40. ;
  41. ; d0=true if succeeded, false if failed.
  42. ; d1-d7/a0-a6 can be trashed. a7 *must* be preserved! ;-)
  43.  
  44.     cmp.w    #37,($C,a0)        ;requires V37+ rom image
  45.     bhs.b    .cont
  46.     moveq    #0,d0
  47.     rts
  48.  
  49. .cont    lea    (.resname,pc),a1
  50.     jsr    (a2)
  51.     tst.l    d0
  52.     beq.b    .nores
  53.  
  54.     move.l    d0,a0
  55.     ;move.b    #RTW_NEVER,(RT_FLAGS,a0)
  56.     clr.b    (RT_FLAGS,a0)
  57.     moveq    #1,d0
  58.     rts
  59.  
  60. .nores    pea    (.resname,pc)
  61.     move.l    sp,a1
  62.     lea    (.mes1,pc),a0
  63.     jsr    (a4)
  64.     addq.l    #4,sp
  65.     moveq    #0,d0
  66.     rts
  67.  
  68. .resname    dc.b    'card.resource',0
  69. .mes1    dc.b    'RemCards: %s not found!',10,0
  70.  
  71.  
  72.     SECTION    VERSION,DATA
  73.  
  74.     dc.b    '$VER: RemCards_PATCH 1.0 (24.5.97)',0
  75.